spinbutton: Add accessors for (max-)width-chars
authorTimm Bäder <mail@baedert.org>
Sat, 6 May 2017 15:05:58 +0000 (17:05 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:12 +0000 (21:27 -0400)
docs/reference/gtk/gtk4-sections.txt
gtk/gtkspinbutton.c
gtk/gtkspinbutton.h

index 04704a4b5ca89f115d499a7a3f562ece144fe9dc..1bc1d5ea05c044894069482540bebb57a34460a9 100644 (file)
@@ -2741,6 +2741,10 @@ gtk_spin_button_get_value
 gtk_spin_button_get_wrap
 gtk_spin_button_set_text
 gtk_spin_button_get_text
+gtk_spin_button_set_max_width_chars
+gtk_spin_button_get_max_width_chars
+gtk_spin_button_set_width_chars
+gtk_spin_button_get_width_chars
 GTK_INPUT_ERROR
 <SUBSECTION Standard>
 GTK_SPIN_BUTTON
index 9dca8ae7f153922d9afaa9b8a3a4c6e271edbc4f..488bca623cac44acc06ca7dbf67135ae8c547e31 100644 (file)
@@ -2305,3 +2305,48 @@ gtk_spin_button_set_text (GtkSpinButton *spin_button,
 
   g_object_notify (G_OBJECT (spin_button), "text");
 }
+
+int
+gtk_spin_button_get_max_width_chars (GtkSpinButton *spin_button)
+{
+  GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
+
+  g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), -1);
+
+  return gtk_entry_get_width_chars (GTK_ENTRY (priv->entry));
+}
+
+
+void
+gtk_spin_button_set_max_width_chars (GtkSpinButton *spin_button,
+                                    int            max_width_chars)
+{
+  GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
+
+  g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
+
+  gtk_entry_set_max_width_chars (GTK_ENTRY (priv->entry), max_width_chars);
+  g_object_notify (G_OBJECT (spin_button), "max-width-chars");
+}
+
+int
+gtk_spin_button_get_width_chars (GtkSpinButton *spin_button)
+{
+  GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
+
+  g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), -1);
+
+  return gtk_entry_get_width_chars (GTK_ENTRY (priv->entry));
+}
+
+void
+gtk_spin_button_set_width_chars (GtkSpinButton *spin_button,
+                                 int            width_chars)
+{
+  GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
+
+  g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
+
+  gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), width_chars);
+  g_object_notify (G_OBJECT (spin_button), "width-chars");
+}
index 5dc3b7cd0e121ec90754bb21c9dc09f959c6ba4c..b811b5f9a1583a976771da2103f5161382e32044 100644 (file)
@@ -232,6 +232,18 @@ const char *    gtk_spin_button_get_text           (GtkSpinButton *spin_button);
 GDK_AVAILABLE_IN_3_92
 void            gtk_spin_button_set_text           (GtkSpinButton *spin_button,
                                                     const char    *text);
+GDK_AVAILABLE_IN_3_92
+int             gtk_spin_button_get_max_width_chars (GtkSpinButton *spin_button);
+GDK_AVAILABLE_IN_3_92
+void            gtk_spin_button_set_max_width_chars (GtkSpinButton *spin_button,
+                                                     int            max_width_chars);
+GDK_AVAILABLE_IN_3_92
+int             gtk_spin_button_get_width_chars     (GtkSpinButton *spin_button);
+GDK_AVAILABLE_IN_3_92
+void            gtk_spin_button_set_width_chars     (GtkSpinButton *spin_button,
+                                                     int            width_chars);
+
+
 
 G_END_DECLS